ES6 emit for new import / export syntax#2335
Merged
Conversation
Conflicts: src/compiler/checker.ts src/compiler/diagnosticInformationMap.generated.ts src/compiler/diagnosticMessages.json
Conflicts: src/compiler/checker.ts tests/baselines/reference/es6ImportDefaultBinding.errors.txt tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport1.errors.txt tests/baselines/reference/es6ImportDefaultBindingMergeErrors.errors.txt tests/baselines/reference/es6ImportEqualsDeclaration.errors.txt tests/cases/compiler/es6ImportNameSpaceImportMergeErrors.ts tests/cases/compiler/es6ImportNameSpaceImportNoNamedExports.ts tests/cases/compiler/es6ImportNamedImportInExportAssignment.ts tests/cases/compiler/es6ImportNamedImportInIndirectExportAssignment.ts tests/cases/compiler/es6ImportNamedImportNoNamedExports.ts
Conflicts: src/compiler/diagnosticInformationMap.generated.ts src/compiler/diagnosticMessages.json src/compiler/program.ts tests/baselines/reference/constDeclarations-access5.errors.txt tests/baselines/reference/es6ExportAssignment.errors.txt tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding.errors.txt tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding.js tests/baselines/reference/es6ImportDefaultBindingMergeErrors.errors.txt tests/baselines/reference/es6ImportEqualsDeclaration.errors.txt tests/cases/compiler/es6ImportDefaultBinding.ts tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport.ts tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport1.ts tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportDts.ts tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding.ts tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding1.ts tests/cases/compiler/es6ImportDefaultBindingMergeErrors.ts tests/cases/compiler/es6ImportDefaultBindingNoDefaultProperty.ts tests/cases/compiler/es6ImportNameSpaceImport.ts tests/cases/compiler/es6ImportNamedImport.ts tests/cases/compiler/es6ImportNamedImportMergeErrors.ts tests/cases/compiler/es6ImportNamedImportNoExportMember.ts tests/cases/compiler/es6ImportWithoutFromClause.ts tests/cases/compiler/es6ImportWithoutFromClauseNonInstantiatedModule.ts
Conflicts: src/compiler/emitter.ts tests/baselines/reference/es6ImportDefaultBinding.js tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.js tests/baselines/reference/es6ImportNameSpaceImport.js tests/baselines/reference/es6ImportNamedImport.js
Conflicts: src/compiler/emitter.ts tests/baselines/reference/es6ImportDefaultBinding.js tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.js tests/baselines/reference/es6ImportNameSpaceImport.js tests/baselines/reference/es6ImportNamedImport.js
Conflicts: tests/baselines/reference/es6ExportAll.js tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.js tests/baselines/reference/es6ImportNamedImport.js
…modules Conflicts: src/compiler/checker.ts tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.js tests/baselines/reference/es6ImportNamedImport.js
Conflicts: src/compiler/emitter.ts tests/baselines/reference/es6ExportAll.js tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.js tests/baselines/reference/es6ImportNamedImport.js
Conflicts: src/compiler/emitter.ts tests/baselines/reference/es6ExportAll.js tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.js
Conflicts: src/compiler/emitter.ts
Conflicts: src/compiler/emitter.ts
Note since we havent yet changed the emitting of class declaration to es6 format, we are just exporting the constructor function Conflicts: src/compiler/emitter.ts
Conflicts: src/compiler/emitter.ts tests/baselines/reference/es6ExportAll.js tests/baselines/reference/es6ExportClause.js tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.js
Closed
Contributor
There was a problem hiding this comment.
Is this documented with Jonathan as a breaking change? (it seems like a very big one, erroring on an entire feature if you move to ES6).
Contributor
Author
There was a problem hiding this comment.
yes. that is the current design. we will have a blog post about moving to the new module syntax.
Conflicts: src/compiler/checker.ts src/compiler/emitter.ts src/compiler/program.ts
Conflicts: src/compiler/checker.ts src/compiler/emitter.ts tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.js tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportInEs5.js tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportWithExport.js tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts.js tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5.js tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingWithExport.js
Conflicts: src/compiler/diagnosticInformationMap.generated.ts src/compiler/diagnosticMessages.json
Contributor
There was a problem hiding this comment.
seems it should be isReferencedAliasDeclaration(node.importClause.name)
Conflicts: src/compiler/diagnosticInformationMap.generated.ts src/compiler/diagnosticMessages.json
… name of an export default class
Contributor
There was a problem hiding this comment.
can you add a comment why we don't prefix export name with 'exports.' when emitting for ES6+?
mhegazy
added a commit
that referenced
this pull request
Mar 17, 2015
ES6 emit for new import / export syntax
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is mostly @sheetalkamat's work in #2065, just bringing it up to date and adding implementation for export default.
Notes: